<template>
  <TreeSelect
    type="text"
    v-model="searchValue"
    :data="config.option"
    :placeholder="
      config.placeholder ? config.placeholder : '请输入' + config.label
    "
    clearable
    transfer
    :disabled="config.disabled"
    size="default"
  >
  </TreeSelect>
</template>

<script setup>
import { computed } from 'vue'

const props = defineProps(['model', 'config'])
const emit = defineEmits(['update'])

const searchValue = computed({
  get() {
    return props.model
  },
  set(value) {
    emit('update', props.config, value)
  },
})
</script>

<style scoped lang="less">
:deep(.ivu-select-selection .ivu-select-selected-value) {
  font-size: 13px;
}

:deep(.ivu-select-selection .ivu-select-placeholder) {
  font-size: 13px;
}
:deep(.ivu-select-selection) {
  padding-left: 3px;
  border-radius: 20px;
}
</style>
